package com.leinao.service.impl;

import com.leinao.annotation.DataSource;
import com.leinao.domain.DeviceData;
import com.leinao.domain.enums.DataSourceType;
import com.leinao.domain.param.DeviceDataQueryParam;
import com.leinao.mapper.TdengineMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * description
 *
 * @author zhong.wang
 * @date 2025/1/13
 */
@Service
@DataSource(DataSourceType.TDENGINEFROM)
public class TdengineFromService {

    @Resource
    private TdengineMapper tdengineMapper;
    public void createTable(String tableName) {
        tdengineMapper.createTable(tableName);
    }

    public void deleteTable(String tableName){
        tdengineMapper.deleteTable(tableName);
    }

    public List<DeviceData> getListByTs(DeviceDataQueryParam queryParam){
        return tdengineMapper.getListByTs(queryParam);
    }

    public void insertDeviceData(List<DeviceData> list) {
            this.tdengineMapper.insertDeviceData(list);
    }
}
